package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.Employee;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


import java.util.List;

public interface EmployeeMapper {

    @Select("SELECT * FROM employee where username=#{username}")
    //根据用户名查询登录用户数据
    Employee login(Employee employee);

    //添加员工数据
    @Insert("insert into employee values (null,#{name},#{username},#{password},#{phone},#{sex},#{idNumber},#{status},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    void insert(Employee employee);

    //根据名字查询数据
    List<Employee> findByName(@Param("name") String name);

    //修改员工数据
    void update(Employee employee);

    //根据id查询数据
    @Select("select * from employee where id=#{id} ")
    Employee findById(Long id);
}
